<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<#include "lib/lib.html" />
<title>编辑教师</title>
</head>
<body>
	<form action="${basePath}/teacherInfo/edit.do" method="post" class="form form-horizontal" id="form">
	<input type="hidden" name="id" value="${obj.id}"/>
	<div class="pop_main" style="padding-left:30px;width: 95%;">
		<div class="panel panel-primary mt-20">
	    	<div class="panel-header">教师信息</div>
	    	<div class="panel-body">
	    		<table class="table table-border table-bordered table-hover table-bg table-sort">
					<tbody>
						<tr>
	    		    		<td style="width:120px;"><strong>姓名：</strong></td>
	    		    		<td>
	    		    			<input style="width:300px;" class="dd_input input-text size-M" type="text" placeholder="请输入姓名" id="name" name="name" value="${obj.name}" datatype="*"  nullmsg="请输入姓名" >
	    		    		</td>
	    		    	</tr>
	    		    	<tr>
	    		    		<td style="width:120px;"><strong>照片：</strong></td>
	    		    		<td>
								<input style="width:300px;" readonly="readonly" type="text" class="width200 input-text size-M"  dataType="*" nullmsg="上传照片" name="photoUrl" id="photoUrl" value="${obj.photoUrl}"/>
								<input type="file" class="width150 fileInputClass" name="file" id="photoUrlFile" onchange="uploadFile('${basePath}/upload/addFiles.do','photoUrl','File')"/>
	    		    		</td>
	    		    	</tr>
	    		    	<tr>
	    		    		<td style="width:120px;"><strong>手机号：</strong></td>
	    		    		<td>
	    		    			<input style="width:300px;" class="dd_input input-text size-M" type="text" placeholder="请输入手机号" id="phone" name="phone" value="${obj.phone}" datatype="m"  nullmsg="请输入手机号" >
	    		    		</td>
	    		    	</tr>
	    		    	<tr>
	    		    		<td style="width:120px;"><strong>身份证号：</strong></td>
	    		    		<td>
	    		    			<input style="width:300px;" class="dd_input input-text size-M" type="text" placeholder="请输入身份证号" id="cardId" name="cardId" datatype="idcard" value="${obj.cardId}" nullmsg="请输入身份证号" >
	    		    		</td>
	    		    	</tr>
	    		    	<tr>
	    		    		<td style="width:120px;"><strong>教学类型：</strong></td>
	    		    		<td>
	    		    			<select style="width:300px;height: 30px;" class="select size-M" id="teachType" name="teachType" size="1">
									<option value="1" <#if obj.teachType == 1>selected="selected"</#if>>全职</option> 
									<option value="2" <#if obj.teachType == 2>selected="selected"</#if>>兼职</option> 
								</select>
	    		    		</td>
	    		    	</tr>
	    		    	<tr>
	    		    		<td style="width:120px;"><strong>现任职单位：</strong></td>
	    		    		<td>
	    		    			<input style="width:300px;" class="dd_input input-text size-M" type="text" placeholder="请输入现任职单位" id="company" name="company" value="${obj.company}" datatype="*"  nullmsg="请输入现任职单位" >
	    		    		</td>
	    		    	</tr>
	    		    	<tr>
	    		    		<td style="width:120px;"><strong>现任职职位：</strong></td>
	    		    		<td>
	    		    			<input style="width:300px;" class="dd_input input-text size-M" type="text" placeholder="请输入现任职职位" id="job" name="job" value="${obj.job}" datatype="*"  nullmsg="请输入现任职职位" >
	    		    		</td>
	    		    	</tr>
	    		    	<tr>
	    		    		<td style="width:120px;"><strong>课时费（单次课）：</strong></td>
	    		    		<td>
	    		    			<input style="width:300px;" class="dd_input input-text size-M" type="text" placeholder="请输入课时费" id="teachAmout" name="teachAmout" value="${obj.teachAmout}" datatype="n"  nullmsg="请输入课时费" >
	    		    		</td>
	    		    	</tr>
	    		    	<tr>
	    		    		<td style="width:120px;"><strong>排序：</strong></td>
	    		    		<td>
	    		    			<input style="width:300px;" class="dd_input input-text size-M" type="text" placeholder="请输入排序" id="sortNum" name="sortNum" datatype="n"  nullmsg="请输入排序" value="${obj.sortNum}">
	    		    		</td>
	    		    	</tr>
	    		    	<tr>
	    		    		<td style="width:120px;"><strong>个人简介：</strong></td>
	    		    		<td>
	    		    			<textarea style="width:500px;height:200px;" class="input-text size-M" placeholder="个人简介" id="remark" name="remark">${obj.remark}</textarea>
	    		    		</td>
	    		    	</tr>
    		    	</tbody>
			    </table>
	    	</div>
    	</div>
    	
		<div class="submit_btn">
			<button style="width:100px;height:40px;" type="button" name="" value="提    交" onclick="submitButt()" class="btn btn-warning radius"><i class="Hui-iconfont">&#xe676;</i> 提    交</button>
		</div>
	</div>
	</form>
<script type="text/javascript">
		$(function(){
			$("#form").Validform({
				tiptype:3,
				showAllError:true,   //表单提交时显示所有提示信息
				ignoreHidden: true,  //隐藏的表单元素不校验
				ajaxPost:true,
				callback:function(data){
					$.Hidemsg();
					if(data.resultCode==200){
						layer.msg('保存成功!', {
							icon : 1,
							time : 1000
						});
						//parent.location.replace("${basePath}/payv2PayWayRate/payv2PayWayRateListAll.do?payWayId="+$("#payViewType").val());
						setTimeout(function () { 
					        layer_close();
					    }, 1000);
					}else{
						$("#form").resetForm();
						layer.msg('保存失败，请你检查数据!', {
							icon : 1,
							time : 1000
						});
					}
				}
			});
		});
		
		function uploadFile(url,idstr,filestr) {
			if($("input[id='"+idstr+filestr+"']").val()==""){
  	            layer.msg('请选择上传文件！', function(){});
				return;
			}
			commonUp(url, $("input[id='"+idstr+filestr+"']"), function(data) {
					$("#"+idstr).val(data.Data.url);
			});
	
		}
		
		//无刷新上传文件
		function commonUp(url, e, callback) {
			$.ajaxFileUpload({
				url : url,
				secureuri : false,
				fileElement : e,
				dataType : "JSON",//返回数据的类型
				success : function(data,status) {
					if (data.resultCode == 200) {
						if (callback) {
							callback(data);
						}
					} else {
						//alert("上传失败！");
						alert(data.Data);
					}
					
				}
			});
		}
		
		$(document).ready(function(){
			$('select').searchableSelect();
		});

		function submitButt(){
			$("#form").attr(
					"action",
					"${basePath}/teacherInfo/edit.do").submit(); 
		}

		//验证输入的数字合法性
		function ValidateFloat(e, pnumber){ 
			if (!/^\d+[.]?\d*$/.test(pnumber)){ 
				$(e).val(/^\d+[.]?\d*/.exec($(e).val())); 
			}
			return false; 
		}
</script>
</body>
</html>